package com.dog.basics.api.controller.common;

import com.dog.basics.bean.dto.api.common.FeedbackSaveDto;
import com.dog.basics.common.constant.SwaggerConstants;
import com.dog.basics.common.util.R;
import com.dog.basics.service.common.IDogFeedbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 意见 前端控制器
 * </p>
 *
 * @author fengjukang
 * @since 2019-10-11
 */
@RestController
@Api(value = "意见反馈",tags = SwaggerConstants.API_ALL)
@RequestMapping("/api/feedback")
@AllArgsConstructor
public class ApiFeedbackController {

	private final IDogFeedbackService feedbackService;

	/**
	 * 新增意见反馈
	 * @param dto
	 * @return
	 * @author guonh
	 */
	@ApiOperation(value = "意见反馈",tags = SwaggerConstants.API_MY)
	@PostMapping
	public R<Boolean> addFeedback(@RequestBody @Valid FeedbackSaveDto dto){
		return R.ok(feedbackService.addFeedback(dto));
	}

}
